import request from '@/utils/request'

// 查询样车列表
export function listCar(query) {
  return request({
    url: '/trialproduce/car/list',
    method: 'get',
    params: query
  })
}

// 查询样车详细
export function getCar(carId) {
  return request({
    url: '/trialproduce/car/' + carId,
    method: 'get'
  })
}

// 新增样车
export function addCar(data) {
  return request({
    url: '/trialproduce/car',
    method: 'post',
    data: data
  })
}

// 修改样车
export function updateCar(data) {
  return request({
    url: '/trialproduce/car',
    method: 'put',
    data: data
  })
}

// 删除样车
export function delCar(carId) {
  return request({
    url: '/trialproduce/car/' + carId,
    method: 'delete'
  })
}

// 导出样车
export function exportCar(query) {
  return request({
    url: '/trialproduce/car/export',
    method: 'get',
    params: query
  })
}

// 下载导入模板
export function importTemplate() {
  return request({
    url: '/trialproduce/car/importTemplate',
    method: 'get'
  })
}

// 获取文件列表
export function selectFiles(carId) {
  return request({
    url: '/trialproduce/car/files/' + carId,
    method: 'post',
  })
}

// 删除文件列表
export function deleteFiles(ids) {
  return request({
    url: '/system/file/' + ids,
    method: 'delete',
  })
}

// 查询用户数
export function getUserTree() {
  return request({
    url: '/beiben/system/user/dept/tree/user',
    method: 'get'
  })
}

// 修改样车状态
export function changeState(data) {
  return request({
    url: '/trialproduce/car/changeState',
    method: 'post',
    data: data
  })
}

// 查询维修信息列表
export function listRepair(query) {
  return request({
    url: '/experiment/repair/repairList',
    method: 'get',
    params: query
  })
}

